<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <!-- <script src="defineProperty.js"></script> -->
  <script>
    'use strict'
    const obj = { singer: 'Jay', _age: 40 }
    Object.defineProperties(obj, {
      age: {
        configurable: true,
        enumerable: true,
        get() {
          return this._age
        },
        set(val) {
          this._age = val
        }
      },
      gender: {
        configurable: true,
        enumerable: true,
        writable: true,
        value: '男'
      }
    })

  </script>
</body>

</html>